package com.naiterui.ehp.ps.sms.bean;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.*;

import org.hibernate.annotations.DynamicUpdate;

import lombok.Data;

/**
 * 模板持久化信息
 *
 * @author
 * @since 1.0.0
 */
@Data
@Entity
@DynamicUpdate
@Table(name = "sms_template")
public class Template implements Serializable {

    /**
     * 序列化ID：<code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Integer id;

    @Column(name = "template_id")
    private Integer templateId;     // 模板ID

    @Column(name = "platform_id")
    private Integer platformId;     // 平台id

    @Column(name = "signature_id")
    private Integer signatureId;  // 签名id

    @Column(name = "msg_template_id")
    private String msgTemplateId; // 短信服务商模板ID

    @Column(name = "content")
    private String content;         // 模板内容

    @Column(name = "description")
    private String description;     // 模板描述

    /**
     * 状态(0:启用，1：停用)
     */
    @Column(name = "status")
    private Integer status;

    @Column(name = "created_at")
    private Date createdAt;         // 创建时间

    @Column(name = "changed_at")
    private Date changedAt;         // 修改时间

    @Column(name = "created_by")
    private String createdBy;       // 创建人

    @Column(name = "changed_by")
    private String changedBy;       // 修改人

    @Version       // 版本
    private Integer version;

    public Template() {
    }

}
